package chapter_3;

public class Test17 {
    public static void main(String[] args) {
        String str = "hello";//hello 常量池
        String str1 = new String("world");
        String str2 = new String("hello");//堆

        String str3 = "world";
        String str4 = "helloworld";
        String str5 = str + str3;
        String concat = str.concat(str3);
        System.out.println(concat);
        System.out.println(str == str2);
        System.out.println(str4 == str5.intern());
        System.out.println(str.equals(str2));

        String email = "1231312@qq.com";
        String[] split = email.split("@qq");
        System.out.println(split[0]);
        System.out.println(split[1]);
        System.out.println(email.indexOf("q"));
        System.out.println(email.lastIndexOf("q"));
        System.out.println(email.charAt(7));
        System.out.println(email.substring(7,10));
        System.out.println(email.substring(7));
        System.out.println(email);
        System.out.println(email.trim());

        String str6 = "你好,欢迎,学习,Java,基础";
        String[] split1 = str6.split(",");
        for (String s : split1) {
            System.out.println(s);
        }
        String s = str6.replaceFirst(",", "----");
        String s1 = "abc";
        System.out.println(s1.toUpperCase());
        System.out.println(s);

    }
}
